package com.zhuss.controller.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.product.hotLine.CreateHotLineBo;
import com.zhuss.bean.bo.product.hotLine.DeleteHotLineBo;
import com.zhuss.bean.bo.product.hotLine.UpdateHotLineBo;
import com.zhuss.bean.bo.product.hotLine.StartHotLineBo;
import com.zhuss.bean.bo.product.hotLine.StopHotLineBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.product.hotLine.HotLineOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 热门线路操作的Controller
 * @author: zhushanshuo
 * @create: Mon Jan 11 09:20:35 CST 2021
 **/
@RestController
@RequestMapping("/hotLine")
public class HotLineOperateController extends BaseController {
	
	@Autowired
	@Qualifier("hotLineOperateService")
	private OperateService<Void, Object> hotLineOperateService;
	
	@Autowired
	@Qualifier("hotLineOperateServiceExt")
	private HotLineOperateServiceExt hotLineOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateHotLineBo bo) throws DzcxException {
		
		hotLineOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateHotLineBo bo) throws DzcxException {
		
		hotLineOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteHotLineBo bo) throws DzcxException {
		
		hotLineOperateService.delete(bo);
    }
	
	/**
	 * 启用
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/start")
    public void start(@RequestBody StartHotLineBo bo) throws DzcxException {
		
		hotLineOperateServiceExt.start(bo);
    }
	
	
	/**
	 * 停用
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/stop")
    public void stop(@RequestBody StopHotLineBo bo) throws DzcxException {
		
		hotLineOperateServiceExt.stop(bo);
    }
	
}
